import numpy as np
import pylab as pl

from matplotlib import mlab

def oneDimensionalHist(vertices, boundary=None):
    vertices = np.array(vertices)
    hist, bins = np.histogram(vertices, bins=100)
    width = 0.7 * (bins[1] - bins[0])
    center = (bins[:-1] + bins[1:]) / 2
    pl.bar(center, hist, align='center', width=width, color='green')
    if boundary is not None:
        pl.vlines([-boundary, boundary], 0, max(hist))
    #x = np.linspace(-50,50,1000)
    #pl.plot(x, 0.7e6 * mlab.normpdf(x,0,12),color='blue')
    pl.show()
